package com.huage_09.lesson_03;

import java.util.function.Function;

public class FunctionDemo {
    public static void main(String[] args) {
        String str = "张三,23";
        int age = covert(str, s -> s.split(",")[1],
                s -> Integer.parseInt(s) + 7);
        System.out.println("age = " + age);
    }
    public static int covert(String str, Function<String,String> fun1,Function<String,Integer> fun2){
        return fun1.andThen(fun2).apply(str);
    }
}
